<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Blog
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: WidgetController.php
 * @author     Jung
 */

/**
 * @category   Application_Extensions
 * @package    Blog
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 */
class Blog_Form_Search extends Engine_Form {
	public function init() {
		$this->setAttribs ( array ('id' => 'filter_form', 'class' => 'global_form_box' ) )->setAction ( Zend_Controller_Front::getInstance ()->getRouter ()->assemble ( array () ) )->setMethod ( 'GET' );
		
		$this->addElement ( 'Text', 'search', array ('label' => 'Search Blogs', 'onchange' => 'this.form.submit();' ) );
		
		$this->addElement ( 'Select', 'orderby', array ('label' => 'Browse By', 'multiOptions' => array ('creation_date' => 'Most Recent', 'view_count' => 'Most Viewed' ), 'onchange' => 'this.form.submit();' ) );
		
		$this->addElement ( 'Select', 'draft', array ('label' => 'Show', 'multiOptions' => array ('' => 'All Entries', '0' => 'Only Published Entries', '1' => 'Only Drafts' ), 'onchange' => 'this.form.submit();' ) );
		
		$this->addElement ( 'Select', 'show', array ('label' => 'Show', 'multiOptions' => array ('1' => 'Everyone\'s Blogs', '2' => 'Only My Friends\' Blogs' ), 'onchange' => 'this.form.submit();' ) );
		
		$this->addElement ( 'Select', 'category', array ('label' => 'Category', 'multiOptions' => array ('0' => 'All Categories' ), 'onchange' => 'this.form.submit();' ) );
		
		$this->addElement ( 'Hidden', 'page', array ('order' => 100 ) );
		
		$this->addElement ( 'Hidden', 'tag', array ('order' => 101 ) );
		
		$this->addElement ( 'Hidden', 'start_date', array ('order' => 102 ) );
		
		$this->addElement ( 'Hidden', 'end_date', array ('order' => 103 ) );
	}
}